/**create by liuhua at 2020年5月18日 下午5:58:34**/
package com.star.aries.exception;

import com.star.aries.constant.ErrorCodeEnum;

import lombok.Getter;

@Getter
public class HnServiceException extends RuntimeException {
  private static final long serialVersionUID = 1L;
  
  private String msg;
  private int code = ErrorCodeEnum.SYSTEM_ERROR.getCode();

  public HnServiceException(Throwable e) {
    super(e);
  }

  public HnServiceException(String msg) {
    super(msg);
    this.msg = msg;
  }

  public HnServiceException(String msg, Throwable e) {
    super(msg, e);
    this.msg = msg;
  }
  
  public HnServiceException(int code, String msg) {
    super(msg);
    this.msg = msg;
    this.code = code;
  }
  
  public HnServiceException(ErrorCodeEnum erroCode, String msg) {
    super(msg);
    this.msg = msg;
    this.code = erroCode.getCode();
  }

  public HnServiceException(ErrorCodeEnum erroCode) {
    super(erroCode.getMsg());
    this.msg = erroCode.getMsg();
    this.code = erroCode.getCode();
  }

  public HnServiceException(int code, String msg, Throwable e) {
    super(msg, e);
    this.msg = msg;
    this.code = code;
  }
}